#!/bin/sh

archi=`uname -m`
if [ x"$archi" == x"aarch64" ]; then
    mkdir -p /usr/include/ifm_nettle/
    cp -f /home/lizengyi/ifm_nettle/src/*.h /usr/include/ifm_nettle/
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/home/lizengyi/ifm_nettle/build/src/
    gcc main.c nettle.c -L/home/lizengyi/ifm_nettle/build/src/ -lifm_nettle -lnettle -lwd -g -o main
else
    gcc main.c nettle.c -lnettle -lwd -g -o main
fi
if [ $? -ne 0 ];then
    echo "Failed: gcc failed, exit"
    exit 1
fi

./main